Supported Chains
web3agent supports 17 EVM-compatible chains out of the box. Every chain ships with a built-in public RPC endpoint so you can get started without any additional configuration. Blockscout indexer support is available on 8 of those chains, unlocking the full suite of explorer tools.
Chain Reference
| Chain | Chain ID | Default RPC | Blockscout Support |
|---|---|---|---|
| Ethereum | 1 | Yes | Yes |
| Base | 8453 | Yes | Yes |
| Arbitrum | 42161 | Yes | Yes |
| Optimism | 10 | Yes | Yes |
| Polygon | 137 | Yes | Yes |
| Linea | 59144 | Yes | No |
| BSC | 56 | Yes | No |
| Avalanche | 43114 | Yes | No |
| zkSync Era | 324 | Yes | Yes |
| Scroll | 534352 | Yes | Yes |
| Mode | 34443 | Yes | No |
| Blast | 81457 | Yes | No |
| Mantle | 5000 | Yes | No |
| Celo | 42220 | Yes | No |
| Gnosis | 100 | Yes | Yes |
| Sepolia | 11155111 | Yes | No |
| Base Sepolia | 84532 | Yes | No |
Base (8453) is the default chain. All tools that accept a chainId parameter will use Base unless you specify otherwise.
Blockscout-Enabled Chains
The following 8 chains have full Blockscout indexer support, which powers the blockscout_* family of explorer tools (address info, transaction history, token transfers, contract ABIs, NFT metadata, and more):
- Ethereum (1)
- Base (8453)
- Arbitrum (42161)
- Optimism (10)
- Polygon (137)
- Gnosis (100)
- Scroll (534352)
- zkSync Era (324)
On chains without Blockscout support, the evm_* tools still work for live on-chain reads (balances, contract calls, gas estimation), but indexed historical data is not available.
Configuring the Default Chain
Environment variable
Set CHAIN_ID in your environment to change the global default:
CHAIN_ID=42161 # Use Arbitrum as default
Per-call override
Most tools and SDK functions accept a chainId parameter that overrides the default for that specific call:
import { getSwapQuote } from "web3agent";
const quote = await getSwapQuote({
fromToken: "0x...",
toToken: "0x...",
fromAmount: "1000000",
chainId: 42161, // Arbitrum, regardless of CHAIN_ID env var
});
Custom RPC endpoint
To use a private or faster RPC for the default chain, set RPC_URL:
RPC_URL=https://mainnet.infura.io/v3/YOUR_KEY
CHAIN_ID=1
RPC_URL applies only to the chain specified by CHAIN_ID. For other chains, the built-in public RPCs are used.
Chain Resolution
Two SDK functions let you look up chain metadata programmatically:
import { getChain, findChainByName } from "web3agent";
// Look up by numeric ID
const base = getChain(8453);
// { id: 8453, name: "Base", nativeCurrency: { symbol: "ETH", decimals: 18 }, ... }
// Look up by name (case-insensitive)
const arb = findChainByName("arbitrum");
// { id: 42161, name: "Arbitrum One", ... }
Both functions return undefined if the chain is not found, so check the return value before using it.
Testnets
Sepolia (11155111) and Base Sepolia (84532) are included for development and testing. They behave identically to mainnet chains from the API perspective, but Blockscout indexer support is not available on either testnet.
Testnet chains use test ETH with no real value. Make sure CHAIN_ID is set correctly before executing any write operations.